package com.wuwei.elearning.question.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wuwei.elearning.question.domain.QuestionItem;
import com.wuwei.elearning.question.vo.EChartsPieVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 每个单独的问题都会生成一个question_item Mapper 接口
 * </p>
 *
 * @author wuwei
 * @since 2024-01-17
 */
public interface QuestionItemMapper extends BaseMapper<QuestionItem> {

    /**
     * 查询questionItem表中某名学员未考的试卷
     * @param title
     * @param gradeId
     * @param account
     * @param skipPage
     * @param pageSize
     * @return
     */
    List<QuestionItem> selectNotSubmit(@Param("title") String title,@Param("gradeId")  Long gradeId,@Param("account")  Long account, @Param("subjectId") Integer subjectId,
                                       @Param("skipPage")  Integer skipPage,@Param("pageSize")  Integer pageSize);

    /**
     * 查询questionItem表中某名学员未考的试卷的数量
     * @param title
     * @param gradeId
     * @param account
     * @return
     */
    Integer selectNotSubmitCount(@Param("title") String title,@Param("gradeId")  Long gradeId,@Param("account")  Long account, @Param("subjectId") Integer subjectId);

    /**
     * 查找学员应该做的试卷
     * @param title
     * @param gradeId
     * @param account
     * @param subjectIds
     * @param skipPage
     * @param pageSize
     * @return
     */
    List<QuestionItem> selectNotSubmitBySubject(@Param("title") String title, @Param("gradeId") Long gradeId, @Param("account") Long account,
                                                @Param("subjectIds") List<Long> subjectIds, @Param("skipPage") Integer skipPage, @Param("pageSize") Integer pageSize);

    /**
     * 查找学员应该做的试卷数量
     * @param title
     * @param gradeId
     * @param account
     * @param subjectIds
     * @return
     */
    Integer selectNotSubmitCountBySubject(@Param("title") String title, @Param("gradeId") Long gradeId, @Param("account") Long account,
                                       @Param("subjectIds") List<Long> subjectIds);


    List<EChartsPieVo> selectQuestionIdByAccount(Long account);
}
